package com.jevons.muffin.widget.zloading;


import com.jevons.muffin.widget.zloading.circle.DoubleCircleBuilder;
import com.jevons.muffin.widget.zloading.circle.SingleCircleBuilder;
import com.jevons.muffin.widget.zloading.circle.SnakeCircleBuilder;

/**
 * @author linaisheng
 * Created at 2019/3/21.
 */

public enum Z_TYPE {

    DOUBLE_CIRCLE(DoubleCircleBuilder.class),
    SINGLE_CIRCLE(SingleCircleBuilder.class),
    SNAKE_CIRCLE(SnakeCircleBuilder.class);

    private final Class<?> mBuilderClass;

    Z_TYPE(Class<?> builderClass) {
        this.mBuilderClass = builderClass;
    }

    <T extends ZLoadingBuilder> T newInstance() {
        try {
            return (T) mBuilderClass.newInstance();
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }
}
